package com.flexrrb.skin
{
	import flash.events.KeyboardEvent;
	
	import mx.skins.ProgrammaticSkin;

	public class DefaultGroupTextInputItemSkin extends ProgrammaticSkin
	{
		public static const STATE_NORMAL:String = "stateNormal";
		public static const STATE_SELECTED:String = "stateSelected";
		private var _state:String = STATE_NORMAL;
		
		public function DefaultGroupTextInputItemSkin()
		{
			super();
		}
		
		public function set state(value:String):void
		{
			_state = value;
			invalidateDisplayList();	
		}
		
		public function get state():String
		{
			return _state;
		}
		
		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
		{
			super.updateDisplayList(unscaledWidth, unscaledHeight);
			
			graphics.clear();
			
			switch(state)
			{
				case STATE_NORMAL:		
					graphics.beginFill(0xc2c2c2);
				break;
				
				case STATE_SELECTED:
					graphics.beginFill(0xe4e4e4);
				break;
			}
			
			graphics.drawRoundRect(1, 1, unscaledWidth - 2, unscaledHeight - 2, 10, 10);
			graphics.endFill();
			
			
		}
	}
}